package org.swu.swuse.web.controller;

import java.util.List;

import javax.annotation.Resource;

import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.swu.swuse.meta.Tag;
import org.swu.swuse.service.TagService;

/**
 * 首页控制器
 * 
 * @author zhanjingbo
 *
 */
@Controller
public class IndexController {

	@Resource
	private TagService tagService;

	@RequestMapping("/")
	public ModelAndView index() throws Exception {
		ModelAndView mav = new ModelAndView();
		List<Tag> tags = tagService.getIndexTags();
		System.out.println(tags.get(0).getLinks().size());
		mav.addObject("tags", tags);
		mav.setViewName("index");
		return mav;
	}

}
